package main

import "fmt"

//#link: https://leetcode-cn.com/problems/excel-sheet-column-title/
func main() {
	fmt.Println(convertToTitle(701))
}

func convertToTitle(columnNumber int) string {
	result := make([]byte, 0)
	for columnNumber > 0 {
		columnNumber--
		result = append(result, byte('A'+(columnNumber%26)))
		columnNumber /= 26
	}
	for i := 0; i < len(result)>>1; i++ {
		result[i], result[len(result)-1-i] = result[len(result)-1-i], result[i]
	}
	return string(result)

}
